package com.itheima.tliaswebmanagement.exception;

import com.itheima.tliaswebmanagement.pojo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {
    @ExceptionHandler
    public Result handle(Exception e){
        log.info("捕获异常：{}",e);
        e.printStackTrace();
        return Result.error("服务器异常，请联系管理员");

    }
}
